package com.howard.core;

import org.junit.Before;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public abstract class AbstractSpringJunit {

	private ApplicationContext ctx;

	@Before
	public void setUp() {
		ctx = new ClassPathXmlApplicationContext(new String[] {
				"classpath:config/spring.xml",
				"classpath:config/spring-datasource.xml" });
	}

	public ApplicationContext getCtx() {
		return ctx;
	}

	public <T> T getBean(Class<T> clazz) {
		return ctx.getBean(clazz);
	}
}
